import request from "@/utils/request";
// 获取收货地址列表
export function getAddress(data) {
  return request({
    url: "/api/v1/addresses",
    method: "get",
    params: { data },
  });
}
// 获取单条收货地址
export function getSingleAddress(id) {
  return request({
    url: " /api/v1/addresses/" + id,
    method: "get",
  });
}
export function getSingleAddressID(id) {
  return request({
    url: "/api/v1/addresses/" + id,
    method: "get",
  });
}
//收货地址删除
export function getSingleAddressDEL(id) {
  return request({
    url: " /api/v1/addresses/" + id,
    method: "delete",
  });
}
// 新增收货地址
export function addAddress(data) {
  return request({
    url: "/api/v1/addresses",
    method: "post",
    data,
  });
}
// 收货地址修改
export function changeAddress(id, data) {
  return request({
    url: "/api/v1/addresses/" + id,
    method: "put",
    data,
  });
}
// 删除收货地址
export function delAddress(id) {
  return request({
    url: "/api/v1/addresses/" + id,
    method: "delete",
  });
}
